//
//  UIView+ScreenShot.m
//  GuQu
//
//  Created by HELIUM STAR on 15/5/8.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "UIView+ScreenShot.h"

@implementation UIView (ScreenShot)

- (UIImage *)imageWithScreenShot
{
    UIGraphicsBeginImageContext(self.bounds.size);
//    CGContextRef context = UIGraphicsGetCurrentContext();
//    [self.layer renderInContext:context];
    [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
    UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return screenImage;
}

@end
